/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package ticketmachine.dataObjects;

import java.util.Collection;
import java.util.HashMap;
import java.util.List;
import ticketmachine.logic.TicketDescription;

/**
 *
 * @author oiiv2253
 */
public class TicketDescriptionDAO implements ITicketDescriptionDAO {

   private HashMap <Integer,TicketDescription> ticketDescriptionList;

   public TicketDescriptionDAO () {

       ticketDescriptionList = new HashMap <Integer,TicketDescription>();
   }

    public TicketDescription getDescriptionById(int id) {

        TicketDescription ticketDesc;

        ticketDesc = (TicketDescription)ticketDescriptionList.get(id);

        return ticketDesc;
    }

    public Collection<TicketDescription> getAllTicketDescriptions() {
    	return ticketDescriptionList.values();
    }

    public int createTicketDescription(float base, String name, String priceCalculationClass) {
        int newId=ticketDescriptionList.values().size();
        ticketDescriptionList.put(newId,new TicketDescription(newId,base, name,priceCalculationClass));
        return newId;
    }


}
